package com.billowsoft.blog.service;

import java.util.List;

import com.billowsoft.blog.bean.Article;
import com.billowsoft.blog.dao.ArticleDAO;
import com.billowsoft.blog.dao.ArticleDAOImpl;

public class ArticleService {

	private static ArticleDAO dao = new ArticleDAOImpl();

	public Article create(Article article) {
		String id = dao.storeArticle(article);
		article.setId(id);
		return article;
	}

	public Article get(String id) {
		return dao.getArticle(id);
	}
	
	public List<Article> listArticles(int offset, int limit){
		return dao.searchArticles(offset, limit);
	}
}
